﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SimpleServiceBus.Bus.Pipeline;

namespace SimpleServiceBus.Bus.MessageManagement
{
    public class HeaderValueProviderBinding : MessageTypePredicate
    {
        public IMessageValueProvider HeaderValueProvider { get; set; }
        public string HeaderKey { get; set; }

        public string GetHeaderValue(MessageEnvelope message,IMessageContext messageContext)
        {
            if (HeaderValueProvider == null)
                return String.Empty;

            return HeaderValueProvider.GetMessageValue(message, messageContext);

        }
    }
}
